package com.sctvcloud.bazhong.beans;

import android.support.annotation.NonNull;
import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;
import com.ruihang.generalibrary.utils.IDataDate;

import java.sql.Date;

/**
 * Created by rh008 on 2017/7/27.
 */

public class ChatItem implements IDataDate {
//    answerTo		string
//    avatar		string
//    comment		string
//    commentId		string
//    nickName		string
//    pubTime


    private String commentId;
    private String userId;
    private String nickName;
    private String pubTime;
    private String avatar;
    @SerializedName(value = "comment",alternate = {"conmment"})
    private String comment;
    private Date timeTemp;

    public String getChatId() {
        return commentId;
    }

    public void setChatId(String chatId) {
        this.commentId = chatId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return nickName;
    }

    public void setUserName(String userName) {
        this.nickName = userName;
    }

    public String getPubTime() {
        return pubTime;
    }

    public void setPubTime(String pubTime) {
        if (!TextUtils.equals(pubTime, this.pubTime)) {
            timeTemp = null;
        }
        this.pubTime = pubTime;
    }

    public String getUserIcon() {
        return avatar;
    }

    public void setUserIcon(String userIcon) {
        this.avatar = userIcon;
    }

    public String getChatContent() {
        return comment;
    }

    public void setChatContent(String chatContent) {
        this.comment = chatContent;
    }

    @Override
    public Date getDataDate() {
        return timeTemp;
    }

    @Override
    public void setDataDate(Date date) {
        this.timeTemp = date;
    }

    @NonNull
    @Override
    public String getDatePattern() {
        return "yyyy-MM-dd HH:mm:ss";
    }

    @Override
    public String getDateString() {
        return pubTime;
    }

    @Override
    public String toString() {
        return "ChatItem{" +
                "commentId='" + commentId + '\'' +
                ", userId='" + userId + '\'' +
                ", nickName='" + nickName + '\'' +
                ", pubTime='" + pubTime + '\'' +
                ", avatar='" + avatar + '\'' +
                ", comment='" + comment + '\'' +
                ", timeTemp=" + timeTemp +
                '}';
    }
}
